package com.javafactroy.kunlong.codegen;

import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
import com.javafactroy.kunlong.codegen.context.AppContext;
import com.javafactroy.kunlong.codegen.ui.MainFrame;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ApplicationContext;

@SpringBootApplication(exclude={DruidDataSourceAutoConfigure.class,DataSourceAutoConfiguration.class})
public class Codegen {

    public static void main(String[] args) {

        try {
            SpringApplicationBuilder builder = new SpringApplicationBuilder(Codegen.class);
            ApplicationContext applicationContext = builder.headless(false).run(args);
            MainFrame mainFrame = applicationContext.getBean(MainFrame.class);
            System.out.println("config properties:" + AppContext.getProps());

            mainFrame.setVisible(true);
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
//    yum install psmisc -y
//    killall -9 nginx
